------------------------------------------------------- MX COBOL (mxc.lst) MX COBOL Version 3.0 - EN, Copyright (c) Vlastimil Cevela 1996, 2006 (20060528) D:\CeW\cobol\p\mx_c1.cb WHEN-COMPILED = 04/06/06 06:29:50 Registered user: 060529 Name, City, Country 0001 * Sequential file handling mx_c1.cb 0002 * 0003 file-control. 0004 select FIL assign NAM organization line sequential. 0005 file section. 0006 fd FIL. 0007 1 REC pic x(80). 0008 * 0009 working-storage section. 0010 1 E pic 9 value 0. 0011 88 OUT-END value 1. 0012 1 NAM pic x(80) value "mx_c1.tmp". 0013 1 INP pic x(80) value ".". 0014 88 INP-END value " ". 0015 0016 procedure division. 0017 inspect NAM replacing ending " " by #00#. | 0012 0018 * obliged for the file-names in the MX COBOL 0019 * 0020 display "Data transfer from the keyboard into text-file:". 0021 display " ". 0022 * 0023 open output FIL. | 0006 0024 perform until (INP-END) | 0014 0025 display "data input / only Enter = end" 0026 accept INP 0027 if not (INP-END) | 0013 0014 0028# write REC from INP. | 0007 0013 0029 close FIL. | 0006 0030 * 0031 display "Data transfer from the text-file on the screen:". 0032 display " ". 0033 * 0034 open input FIL. | 0006 0035 perform READ-FILE until (OUT-END). | 0011 0036 close FIL. | 0006 0037 * 0038 call "ICRUN" using "del mx_c1.tmp". 0039 stop run. 0040 * 0041 READ-FILE. 0042 read FIL 0043 end | 0006 0044# move 1 to E. | 0010 0045 if not (OUT-END) | 0011 0046 display REC 0047# accept E. | 0007 0010 DATA DIRECTORY: LV NAME OF ITEM ADDR TP LENG LINE REFERENCE FD FIL 0006 0023 0029 0034 0036 0042 01 REC 0 AN 80 0007 0028 0046 01 E 0 DI 1 0010 0044 0047 88 OUT-END 0011 0035 0045 01 NAM 8 AN 80 0012 0016 0017 01 INP 88 AN 80 0013 0026 0028 88 INP-END 0014 0024 0027 77 TALLY 168 BI 4 0000 77 NSTD-REELS 172 BI 2 0000 77 WHEN-COMPILED 176 AN 16 0000 ERROR LISTING: line 0003: warning 0002 level 0 (some division/section/paragraph header before FILE-CONTROL missing - never mind) line 0005: warning 0002 level 0 (some division/section/paragraph header before FILE missing - never mind) line 0004: warning 9005 level 0 (it has to be hexadecimal 00 (#00#) after the last valid character in the file-name) Errors: 0, warnings: 3 Turbo C Version 2.01 Copyright (c) 1987, 1988 Borland International d:\cew\cobol\p\mx_c1.c: Available memory 347778 Turbo C Version 2.01 Copyright (c) 1987, 1988 Borland International Turbo Link Version 2.0 Copyright (c) 1987, 1988 Borland International Available memory 413700 ------------------------------------------------------- main source C (.c) /* 0001 * Sequential file handling mx_c1.cb */ /* 0002 * */ /* 0003 file-control. */ /* 0004 select FIL assign NAM organization line sequential. */ /* 0005 file section. */ /* 0006 fd FIL. */ /* 0007 1 REC pic x(80). */ /* 0008 * */ /* 0009 working-storage section. */ /* 0010 1 E pic 9 value 0. */ /* 0011 88 OUT-END value 1. */ /* 0012 1 NAM pic x(80) value "mx_c1.tmp". */ /* 0013 1 INP pic x(80) value ".". */ /* 0014 88 INP-END value " ". */ /* 0015 */ /* 0016 procedure division. */ #include "D:\CeW\cobol\p\mx_c1.d" #undef MXPE #define MXPE(x,y) goto x /* MX COBOL - Jan 08 2000, 16:35:41 */ _l0001: /* @@@ */ /* 0017 inspect NAM replacing ending " " by #00#. */ /* INSPECT */ Y=(X=W+8)+80; Z=Y; while (Z>X && *--Z==' ') {*Z=0;} /* . */ /* 0018 * obliged for the file-names in the MX COBOL */ /* 0019 * */ /* 0020 display "Data transfer from the keyboard into text-file:". */ /* DISPLAY */ fprintf(J0,"Data transfer from the keyboard into text-file:\n"); /* . */ /* 0021 display " ". */ /* DISPLAY */ fprintf(J1," \n"); /* . */ /* 0022 * */ /* 0023 open output FIL. */ /* OPEN */ F[0].forg=FORG00; F[0].frecf=0; F[0].fst=NULL; F[0].fn=W+8; F[0].rsz=80; icbfopn(&F[0],2); /* . */ /* 0024 perform until (INP-END) */ /* PERFORM */ for(;!(((/* 0025 display "data input / only Enter = end" */ (icbacmp(W+88,80L," ",1L) == 0))));) { /* 1 */ /* DISPLAY */ /* 0026 accept INP */ fprintf(J2,"data input / only Enter = end\n"); /* ACCEPT */ /* 0027 if not (INP-END) */ Y=(X=W+88)+80; while (X #include #include #include "c:\mxc\mxcsdtf.h" #include "c:\mxc\mxcicb.h" static void lojo(jmp_buf); static void lojo(lj1) jmp_buf lj1; {longjmp(lj1,1);} #define XERNF 0x01 extern jmp_buf ps[]; extern short pk[]; static unsigned char flag=0; /* 0x80 = ON SIZE ERROR, 0x40 = READY TRACE */ static short i0,i1; static short exprog=0; extern long xferr; static unsigned char W[8]={'0'}; static unsigned char W1[168]={'m','x','_','c','1','.','t','m','p',' ',' ', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','.',' ',' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',0,0,0, 0,0,0}; static unsigned char W2[16]={'0','4','/','0','6','/','0','6','0','6',':', '2','9',':','5','0'}; static struct sdtf F[1]; /* tabulky souboru */ static void _(int,char**); #define J0 stdout #define J1 stdout #define J2 stdout struct J4 {char j[80];}; #define J5 stdout #define J6 stdout #define J7 stdout #pragma warn -par static short _f0002(int argc, char **argv); #define PK(x) if(pk[x]) lojo(ps[x]) static jmp_buf ps[2]; static short pk[2]; #define FORG00 2 unsigned char icbdisac=0, icbbarvy = 0x07; #define STOPRUN static unsigned char *X,*Y,*Z,*Z1; /* pomocne ukazatele */ static long l0,l1,l2,l3; static double d0,d1,d2,d3; static unsigned char P[33]; /* pracovni pole pro vsechny */ static void _(int,char**); ANONYMUS() {exprog++; _(0,(char **)0L); return 0;} unsigned int _stklen = 6 * 1024; struct sicxh icxh; /**/int main(int argc, char **argv) {icbhe(); _(argc,argv); return 0;} #include "D:\CeW\cobol\p\mx_c1.t" #pragma warn -par static void _(int argc, char **argv) /* toto je preklad PROCEDURE */ { /* konec zdroje .d */ ------------------------------------------------------- 2nd include C (.t) #define MXPE(x,y) return y #pragma warn -par static short _f0002( int argc, char **argv ) { /* 0042 read FIL */ /* READ */ /* 0043 end */ icbrsq(&F[0]); /* 0044 move 1 to E. */ if (F[0].dflag&AEIK) { /* 1 */ /* MOVE */ *(W)='1'; /* . */ } /* 1 */ /* 0045 if not (OUT-END) */ /* IF */ if (!((/* 0046 display REC */ *(W) == '\x31'))) { /* 1 */ /* DISPLAY */ /* 0047 accept E. */ fprintf(J7,"%.80s\n",F[0].r01); /* ACCEPT */ Y=(X=W)+1; while (X